﻿<%@ page language="java" import="java.util.*,cn.ac.cintcm.dataconverge.util.Constants,com.hs.core.utils.*" pageEncoding="UTF-8"%>
<%@ page import ="cn.ac.cintcm.dataconverge.researchsubject.domain.*,cn.ac.cintcm.dataconverge.researcher.domain.*" %> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
Subject obj = (Subject)request.getAttribute("subject");
List fileType = (List)request.getAttribute("fileType");
String reload = (String)request.getAttribute("reload");
String imagePath = path + "/index/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title><%=Constants.APP_TITLE%>-文档上传</title> 
    <script language="javascript" type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
	<script language="javascript" src="<%=path %>/index/Scripts/script.js"></script>
	<script language="javascript" src="<%=path %>/js/common.js"></script>
	<link href="<%=path %>/index/Themes/com/style.css" type="text/css" rel="stylesheet"></link>
	<script src='<%=basePath%>dwr/util.js'></script>  
	 <script type="text/javascript">
	    function uploadFile(){
	            if('' == form1.title.value){
	            	alert("请填写文档名称");
	            	return;
	            }
	            if('0' == form1.fileType.value){
	            	alert("请选择文件类型");
	            	return;
	            }
	            if(isNull(form1.document.value)){
	            	alert("请选择文件");
	            	return;
	            }
	    		form1.submit();
	    } 
    </script>
</head>
<body class="idt_body" scroll="yes">
<form name="form1" action="<%=path %>/document.htm?action=hisDocUpload" method="post" enctype="multipart/form-data">
    <table cellpadding="0" cellspacing="0" width="100%" height="100%" id="Table8">
        <tr>
            <td valign="top" height="100%">
                <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" id="Table11">
                    <tr>
                        <td class="idt_main_m">
                            <!------------------ 标题栏 ------------------>
                            <!--- 标题 ---->
                            <table class="idt_tle_mg" cellspacing="0" cellpadding="0" width="100%">
                                <tr  >
                                    <td class="idt_tle_i">
                                        <img id="imgForm6" src="<%=imagePath %>Themes/com/idt_tle_o.gif"></td>
                                    <td class="idt_tle_f1">
                                        文档上传</td>
                                </tr>
                            </table>
                            <!--- 内容 --->
                            <div id="tdForm">
                                <table border="0" cellpadding="0" cellspacing="1" width="100%" class="com_fieldset_tab">
                                    
                                    <tr>
                                        <td class="fim_l">
                                            文件名称：
                                        </td>
                                        <td class="fim_r" colspan="3" style="width:100%">
                                            <input type="text" class="com_textbox" style="width:80%"   name="title" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="fim_l">
                                            上传文件类型：
                                        </td>
                                        <td class="fim_r" colspan="3">
                                            <select class="com_select" name="fileType">
                                                <option value="0">-----选择文件类型------</option>
                                                <%if(null != fileType){
                                                	 for(int i = 0;i<fileType.size();i++){
                                                		 SystemDict dict = (SystemDict)fileType.get(i);
                                                		 out.println("<option value="+dict.getId()+">");
                                                		 out.println(dict.getName());
                                                		 out.println("</option>");
                                                	 }
                                                }
                                                	%> 
                                            </select>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="fim_l"> 
                                           选择文件
                                        </td>
                                        <td class="fim_r" colspan="3" style="width:100%">
                                            <input type="file" onmouseover='this.blur();' onpaste='return false;' onkeydown='this.blur();return false;' oncontextmenu='return false;' name="document" class="com_textbox" style="width:100%"/>
                                        </td>                           
                                    </tr> 
                                    <tr>
                                        <td class="fim_l"> 
                                          备注
                                        </td>
                                        <td class="fim_r" colspan="3" style="width:100%">
                                            <textarea rows="5" cols="55" name="remark"></textarea>
                                        </td>                           
                                    </tr> 
                                </table>
                                <table cellspacing="0" cellpadding="0" width="100%" class="idt_bottom_mg" border="0">
                                    <tr>
                                        <td align="right">
                                            <input type="button" value="保存"  class="com_btn2"   onclick="javascript:uploadFile();"/>
                                            <input type="button" value="取消"   class="com_btn2" id="Button2" onclick="javascript:window.close();"/>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                </table> 
       </td>
       </tr>
       </table>
       </form>
                
</body>
</html>
<script type="text/javascript">
<!--
<%if(null != reload){%>
    alert("上传成功");
    if(window.opener)
	 window.opener.document.pageForm.submit();
	 window.close();
	
	
<%}%>
//-->
</script>
